#include <algorithm>
#include <cstdio>
#include <cstring>

const int N = 1000005;
int n, ans, top;
char str[N], stk[N];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("wzoi.in", "r", stdin);
  freopen("wzoi.out", "w", stdout);
#endif
#endif

  scanf("%s", str);
  n = strlen(str);
  for (int i = 0; i < n; ++i) {
    if (top && stk[top] == str[i]) ans += 10, --top;
    else stk[++top] = str[i];
  }
  while (top - 2 >= 0) top -= 2, ans += 5;
  printf("%d", ans);
  return 0;
}